<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/master-calendar.xsl"/>
	<xsl:import href="../utilities/date-and-time.xsl"/>

<xsl:template match="data">
	<div class="grid_16" id="sign-in">
		<xsl:choose>
			<xsl:when test="$remember = 'forgot'">
				<h2>Forgot Password</h2>
				
				<xsl:if test="//front-end-authentication/@password-retrieval-email-status = 'sent'">
					<h4>Email sent. Please check your inbox.</h4>
				</xsl:if>
				
				<form method="POST" action="">
					<p>Enter your email address below and you will be sent an email containing your password</p>
						<label>Email Address: 
							<input name="front-end-authentication[username]" type="text" />
						</label>
  					<input type="submit" name="action[front-end-authentication][forgot]" value="Go" />
				</form>
			</xsl:when>
			<xsl:otherwise>
				<form method="POST" action="">
					<div class="grid_5 alpha prefix_1">
						<h2>Please Sign In</h2>
						<p>We'll send you right along.</p>
					</div>
					
					<div class="grid_5">
						<label>Username: <input name="front-end-authentication[username]" type="text"/></label>
						<label>Password: <input name="front-end-authentication[password]" type="password"/></label>
						<input type="hidden" name="redirect" value="{$root}/calendar/" />
						<input type="submit" name="action[front-end-authentication][login]" value="Sign In"/>
					</div>
					
					<div class="grid_5 omega">
						<xsl:if test="//front-end-authentication/@status = 'invalid'">
							<h4>Authentication Failed! Please check your details</h4>
						</xsl:if>
					
						<xsl:if test="//front-end-authentication/@password-retrieval-email-status = 'sent'">
							<h4>Email sent. Please check your inbox.</h4>
						</xsl:if>
					</div>
				</form>
			</xsl:otherwise>
		</xsl:choose>
	</div>
</xsl:template>

</xsl:stylesheet>